package com.atguigu.ioc;

public class HappyComponent {

    public HappyComponent() {
        System.out.println("HappyComponent 对象创建了");
    }

    //添加属性
    private String componentName;

    public String getComponentName() {
        return componentName;
    }

    //必须配置set方法,属性设置,ioc容器是通过set方法调用,进行属性赋值!!!
    public void setComponentName(String componentName) {
        this.componentName = componentName;
    }

    public void doWork() {
        System.out.println("HappyComponent.doWork");
    }

    //引用新组件
    private HappyMachine happyMachine;

    public HappyMachine getHappyMachine() {
        return happyMachine;
    }

    public void setHappyMachine(HappyMachine happyMachine) {
        this.happyMachine = happyMachine;
    }
}